#pragma once

#include "KnowledgeBaseMemoryInterface.h"
#include <vector>

class KnowledgeBaseMemoryFake;
typedef Factory < KnowledgeBaseMemoryInterface >::CastedPtr < KnowledgeBaseMemoryFake > KnowledgeBaseMemoryFakePtr;

class KnowledgeBaseMemoryFake
: public KnowledgeBaseMemoryInterface
{
	friend class Factory < KnowledgeBaseMemoryInterface >;
public:
	static KnowledgeBaseMemoryFakePtr Spawn ();
	static void CheckInnocence ();
private:
	KnowledgeBaseMemoryFake ();
	virtual int ElementsCount ();
	virtual KnowledgeBaseElementInterfacePtr Element ( int index );
	virtual void Append ( KnowledgeBaseElementInterfacePtr element );
	virtual void AppendTypeRoot ( KnowledgeBaseElementInterfacePtr element );
	virtual void AppendValueRoot ( KnowledgeBaseElementInterfacePtr element );
	virtual int TypeRootAddress ();
	virtual int ValueRootAddress ();
public:
	std::vector < KnowledgeBaseElementInterfacePtr > elements;
	std::vector < KnowledgeBaseElementInterfacePtr > addedElements;
	int typeRootAddress;
	int valueRootAddress;
private:
	static Factory < KnowledgeBaseMemoryInterface > factory;
};
